package com.fengxing.ams.web.task.translator;

import java.util.HashMap;
import java.util.Map;

import com.fengxing.ams.pub.AMSException;

public class ForeignLanguageTranslator implements Translator {

	private static final Map<String, String> cache = new HashMap<String, String> ();
	static {
		cache.put("0","不应试外语");
		cache.put("1","英语");
		cache.put("2","俄语");
		cache.put("3","日语");
		cache.put("4","德语");
		cache.put("5","法语");
		cache.put("6","西班牙语");
		cache.put("7","其他外语");
	}
	private static final String message = "期望值：0|1|2|3|4|5|6|7， 而实际值：";
	@Override
	public String translate(String input) {
		if (!cache.containsKey(input))
			throw new AMSException(message+input);
		return cache.get(input);
	}

}
